<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
//    return view('admin');
    return '智能健身站';
});

Auth::routes();
Route::get('/admin', 'HomeController@index')->name('home');
Route::post('photo', 'PhotoController@store');
Route::prefix('admin')->namespace('Admin')->middleware('auth')->group(function () {
    Route::get('system/config/{id}', 'ConfigController@config');
    Route::get('check/sms', 'CheckController@sms');
    Route::get('oncustomer/record/{id}', 'OncustomerController@record');
    Route::put('system/config/{id}', 'ConfigController@save');

    Route::patch('system/sort', 'ConfigController@sort');
    Route::patch('prefercate/sort', 'PreferCateController@sort');
    Route::patch('pack/sort', 'PackController@sort');
    Route::patch('bespeak/sort', 'BespeakController@sort');
    Route::patch('bespeak/change_attr', 'BespeakController@change_attr');
    Route::patch('bespeakcate/sort', 'BespeakCateController@sort');
    Route::patch('coupon/sort', 'CouponController@sort');
    Route::patch('rechargeway/sort', 'RechargewayController@sort');
    Route::patch('member/sort', 'MemberController@sort');

    Route::patch('coupon/change_attr', 'CouponController@change_attr');
    Route::patch('pack/change_attr', 'PackController@change_attr');
    Route::patch('onbespeakorder/change_attr', 'OnbespeakorderController@change_attr');
    Route::patch('onpackorder/change_attr', 'OnpackorderController@change_attr');
    Route::patch('oncustomer/change_attr', 'OncustomerController@change_attr');
    Route::patch('oncustomer/change_company', 'OncustomerController@change_company');
    Route::patch('oncustomer/change_yuangong', 'OncustomerController@change_yuangong');
    Route::patch('member/is_use', 'MemberController@is_use');
    Route::patch('member/is_active', 'MemberController@is_active');


    Route::patch('item/sort', 'ItemController@sort');
    Route::delete('helper/delete_all', 'HelperController@delete_all');

    Route::get('/', 'IndexController@index');
    Route::patch('change_attr', 'FixfxsController@change_attr');

    Route::delete('destroy_gallery', 'FixfxsController@destroy_gallery');
    Route::get('recustomer/deposit/{id}', 'RecustomerController@deposit');
    Route::patch('recustomer/change_key', 'RecustomerController@change_key');
    Route::patch('recustomer/sendSms', 'RecustomerController@sendSms');

    Route::put('recustomer/deposit/{id}', 'RecustomerController@save');
    Route::get('recustomer/pay', 'RecustomerController@pay');
    Route::put('recustomer/pay', 'RecustomerController@pay_save');
    Route::get('order/order','OrderController@index');
    Route::get('order/orderrecord/{id}','OrderrecordController@index');
    Route::get('order/redeposit','RedepositController@index');
    Route::get('order/companyplan','CompanyplanController@index');
    Route::get('order/onbespeakorder','OnbespeakorderController@index');
    Route::get('order/packorder','PackorderController@index');
    Route::get('order/packrecord/{id}','PackrecordController@index');
    Route::get('order/classrecord/{id}','ClassrecordController@index');
    Route::get('order/onpackorder','OnpackorderController@index');
    Route::get('order/onfree','OnfreeorderController@index');
    Route::get('recustomer/showplan/{id}','RecustomerController@showplan');
    Route::put('recustomer/saveplan/{id}','RecustomerController@saveplan');
    Route::resource('coupon', 'CouponController');
    Route::resource('bespeakCate', 'BespeakCateController');
    Route::resource('bespeak', 'BespeakController');
    Route::resource('preferCate', 'PreferCateController');
    Route::resource('member', 'MemberController');

    Route::resource('pack', 'PackController');
    Route::resource('item', 'ItemController');
    Route::resource('fixfxscate', 'FixfxscateController');
    Route::resource('fixfxs', 'FixfxsController');
    Route::resource('tag', 'TagController');

    Route::resource('helper', 'HelperController');
    Route::resource('system/image', 'ConfigController');
    Route::resource('recustomer', 'RecustomerController');
    Route::resource('oncustomer', 'OncustomerController');
    Route::resource('check', 'CheckController');
    Route::resource('store', 'StoreController');
    Route::resource('rechargeway', 'RechargewayController');
    Route::resource('ticket', 'TicketController');
    Route::resource('active', 'ActiveController');
    Route::resource('good', 'GoodController');

    //显示充值额度管理页面
    //Route::resource('recharge', 'RechargeController');
    Route::get('listRecharge','RechargeController@listRecharge');
    Route::get('updateRecharge/{id}','RechargeController@updateRecharge');
    Route::get('addRecharge','RechargeController@addRecharge');
    Route::post('addOrUpdateRecharge','RechargeController@addOrUpdateRecharge');
    Route::delete('deleteRecharge/{id}','RechargeController@deleteRecharge');

    //囤票活动说明
    Route::get('listInstruction','HoardingInstructionController@listInstruction');
    Route::get('addInstruction','HoardingInstructionController@addInstruction');
    Route::post('addOrUpdateInstruction','HoardingInstructionController@addOrUpdateInstruction');
    Route::get('updateInstruction/{id}','HoardingInstructionController@updateInstruction');
    Route::delete('deleteInstruction/{id}','HoardingInstructionController@deleteInstruction');
    //囤票活动列表
    Route::get('listHoarding','HoardingController@listHoarding');
    Route::get('addHoarding','HoardingController@addHoarding');
    Route::post('addOrUpdateHoarding','HoardingController@addOrUpdateHoarding');
    Route::get('updateHoarding/{id}','HoardingController@updateHoarding');
    Route::delete('deleteHoarding/{id}','HoardingController@deleteHoarding');

    //显示给指定用户赠送优惠券页面
    Route::get('present/{id}','PresentController@present');
    Route::post('checkPresent','PresentController@checkPresent');
    //删除教练
    Route::delete('del/{id}','FixfxsController@del');


});
